package com.atmc.config;


import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @BelongsProject: SpringCloud1216
 * @BelongsPackage: com.com.atmc.config
 * @Author: chuyings
 * @CreateTime: 2022-11-07  11:01
 * @Version: 1.0
 */
@Configuration
public class MinioConfiger {
    @Autowired
    private MinioFileProperties minioProperties;

    @Bean("minioClient")
    public MinioClient minioClient(){
        MinioClient minioClient = MinioClient.builder().endpoint(minioProperties.getEndpoint())
                .credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey())
                .build();
        return minioClient;
    }

}
